package com.founder.android.data;

import java.util.ArrayList;
import java.util.List;

import com.founder.android.parser.Copyable;

public class GeoData extends Copyable {
	
	private String address;
	
	private List<String> types = new ArrayList<String>();
	
	private String lat;
	
	private String lng;
	
	public GeoData() {
		this("", "", "");
	}
	
	public GeoData(String address, String lat, String lng) {
		this.address = address;
		this.lat = lat;
		this.lng = lng;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getLng() {
		return lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	public String getType() {
		StringBuffer sb = new StringBuffer();
		for (String type : types) {
			sb.append(type);
			sb.append(" ");
		}
		return sb.toString();
	}

	public void addType(String type) {
		types.add(type);
	}
	
	public void clean() {
		types.clear();
	}

	@Override
	public Object clone() {
		GeoData data = (GeoData)super.clone();
		List<String> newTypes = new ArrayList<String>();
		for (String type : types) {
			newTypes.add(type);
		}
		data.types = newTypes;
		return data;
	}
	
}
